package final2107.day02;

import java.util.Iterator;
import java.util.Map;
import java.util.TreeMap;

public class MapIteratorDemo {
    public static void main(String[] args) {
        TreeMap<String,Integer> map = new TreeMap<>();
        map.put("tom",90);
        map.put("jack",90);
        map.put("amy",90);
        map.put("rose",90);
        map.put("tony",90);

        Iterator<Map.Entry<String,Integer>> it =
                map.entrySet().iterator();
        while (it.hasNext()){
            Map.Entry<String,Integer> entry = it.next();
            System.out.println(entry.getKey()+"--"+entry.getValue());
        }
    }
}
